﻿using AutoMapper;
using Enferno.Public.Web.Models;
using Enferno.Public.Web.ShoppingBasket.ViewModels;

namespace Enferno.Public.Web.ShoppingBasket.Mappers
{
    public class BasketViewModelToBasketModelProfile: Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<BasketViewModel, BasketModel>()
                .ForMember(to => to.DiscountCode, opts => opts.Ignore())
                .ForMember(to => to.Promotions, opts => opts.Ignore())
                .ForMember(to => to.Comment, opts => opts.Ignore())
                .ForMember(to => to.OrderReference, opts => opts.Ignore())
                .ForMember(to => to.OnHand, opts => opts.Ignore());
        }

        public override string ProfileName
        {
            get { return GetType().Name; }
        }
    }
}
